<?php
// +----------------------------------------------------------------------
// | Lists.
// +----------------------------------------------------------------------
// | Copyright (c) 2016 http://www.suckseed.cn, All rights reserved.
// +----------------------------------------------------------------------
// | Author: wjf <184521508@qq.com> 2017-07-08
// +----------------------------------------------------------------------

namespace app\portal\controller;

use wjf\controller\HomeBase;
use app\portal\model\PortalCategory;

class Lists extends HomeBase
{
    public function index()
    {
        $id = $this->request->param('id', 0, 'intval');
        $portalCategoryModel = new PortalCategory();

        $category = $portalCategoryModel->where('id', $id)->where('status', 1)->find();

        $this->assign('category', $category);

        $listTpl = empty($category['list_tpl']) ? 'lists' : $category['list_tpl'];

        return $this->fetch('/' . $listTpl);
    }
}